package com.hzh.spark.core

import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.rdd.RDD

object Demo22Error {

  def main(args: Array[String]): Unit = {
    val conf = new SparkConf()

    conf.setAppName("wordCount")
    conf.setMaster("local")

    val sc = new SparkContext(conf)

    val studentRDD: RDD[String] = sc.textFile("data/students.txt")

    studentRDD.foreach(stu=>{
      studentRDD.foreach(stu=>{
        println(stu)
      })
    })


    studentRDD.foreach(stu=>{
      val scoreRDD: RDD[String] = sc.textFile("data/score.txt")
      scoreRDD.foreach(println)
    })


  }

}
